package org.Thread;

public class Threadyield extends Thread{
    public Threadyield(){

    }
    public Threadyield(String name){
        super(name);
    }
    @Override
    public void run() {
        for (int i =0 ; i<100 ;i++){
            if (i % 10 == 0){
               Thread.yield();
            }
            System.out.println(Thread.currentThread().getName()+"线程"+i);
        }
    }

}
